package day14homework;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class TcpClient {
    public static void main(String[] args) throws IOException {
        // 1.创建连接
        Socket socket = new Socket("127.0.0.1",8080);
        // 2.获得输出流
        OutputStream out = socket.getOutputStream();
        // 3.往里面写数据
        out.write("我是你爸爸".getBytes());
        // 4.关闭
        socket.close();
    }
}
